﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//http://www.infoq.com/cn/articles/why-and-how-log
namespace EBA.Logging
{
    /// <summary>
    /// Logger
    /// </summary>
    public interface ILogger
    {

        string Name { get; }

        /// <summary>
        /// Writes the diagnostic message at the specified level.
        /// </summary>
        /// <typeparam name="TData">custom log data type</typeparam>
        /// <param name="name">log name</param>
        /// <param name="level">log level</param>
        /// <param name="message">log message</param>
        /// <param name="data">custom log data</param>
        void Log(string message, LogLevel level=LogLevel.Info, string name=null);

        /// <summary>
        /// 支持自定义形式的数据log
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="message"></param>
        /// <param name="entity"></param>
        /// <param name="level"></param>
        /// <param name="name"></param>
        void Log<TEntity>(string message, TEntity entity, LogLevel level=LogLevel.Info,string name=null);
    }
}
